﻿<UserControl x:Class="OSChina.Controls.FriendListControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
             xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.Resources>
        <DataTemplate x:Key="template_Normal">
            <Grid Width="112" Height="112">
                <Grid.RowDefinitions>
                    <RowDefinition Height="76" />
                    <RowDefinition Height="36" />
                </Grid.RowDefinitions>
                <Image Source="{Binding portrait, Mode=OneWay}"  ImageFailed="Image_ImageFailed" Grid.RowSpan="2" Width="100" Height="100" Margin="6"/>
                <Rectangle Grid.Row="1"  Fill="Black" Opacity="0.7" Width="100" Margin="6" />
                <StackPanel Grid.Row="1" Margin="6,5,0,5" Orientation="Horizontal">
                    <Image Source="{Binding genderImg,Mode=OneTime}" Height="16" Width="16" Margin="3,0,0,0" HorizontalAlignment="Left"/>
                    <TextBlock Text="{Binding name,Mode=OneTime}" FontSize="17" Margin="5,2,0,0" VerticalAlignment="Top" TextWrapping="Wrap" Foreground="White" Width="80" />
                </StackPanel>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">
        <ListBox x:Name="list_Fans" ItemTemplate="{StaticResource template_Normal}" SelectionChanged="list_Fans_SelectionChanged">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <toolkit:WrapPanel ItemWidth="112" ItemHeight="112"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
    </Grid>
</UserControl>
